[skip changelog] Enable Codecov comments on PRs from forks #1819
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)What kind of change does this PR introduce?
Infrastructure enhancement
What is the current behavior?
Versions of the
codecov/codecov-action
GitHub Actions action prior to 1.0.6 required the use of a token provided by Codecov in order to upload coverage data to Codecov. This token was stored in a secret in the Arduino CLI repository and used in the test workflow.For security reasons, secrets are not accessible when a workflow is triggered by an event generated by a fork of the repository. This meant that it was impossible to upload coverage data for the test runs triggered by PRs from forks (codecov/codecov-action#29). A conditional was added to the upload step of the workflow to cause it to only run on
push
event triggers, which effectively prevented its failure for runs on PRs from forks (#388).The token requirement was removed in the 1.0.6 release of
codecov/codecov-action
, but the now pointless conditional was never removed from the workflow. This prevented PRs from forks from receiving the automated code coverage report comments that would otherwise encourage those contributors to resolve coverage deficiencies and facilitate the review process.What is the new behavior?
The harmful conditional is removed from the coverage data upload steps of the workflow and PRs from forks will now receive coverage report comments, just as PRs from branches do already.
Does this PR introduce a breaking change
No breaking change.
Other information
The configuration of the coverage data upload step proposed here is aligned with our standardized "template" workflow:
https://github.com/arduino/tooling-project-assets/blob/d9f73eb4e5b16c0141e184d7f04493cd62221ea4/workflow-templates/test-go-task.yml#L104
That form of the workflow is already in use in several other Arduino tooling projects. For example: